/* eslint-disable max-classes-per-file */
import { JsonProperty, Serializable } from '@/plugins/reflect-metadata';

import TransOrderItem from './TransOrderItem';

@Serializable()
export class TransProductQuery {
  @JsonProperty('cardProductName')
    cardProductName: string = '';

  @JsonProperty('cardProductId')
    cardProductId: number = 0;

  @JsonProperty('faceValue')
    faceValue: number = 0;

  @JsonProperty('userName')
    userName: string = '';

  get body() {
    return {
      cardProductId: this.cardProductId,
      faceValue: this.faceValue,
      userName: this.userName,
    };
  }
}

@Serializable()
export default class TransOrderList {
  @JsonProperty({ name: 'data', type: TransOrderItem })
    items: TransOrderItem[] = [];

  get total() {
    return this.items.length;
  }
}
